﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using MedReg.Classes;

namespace MedReg
{
    [XmlRoot("ArrayOfEmployee", Namespace = "Employee", IsNullable = false)]
    public class EmployeeCollection : ICollection
    {
        public string CollectionName;
        private ArrayList EmployeeArray = new ArrayList();

        public Employee this[int index]
        {
            get { return (Employee)EmployeeArray[index]; }
        }


        public void CopyTo(Array a, int index)
        {
            EmployeeArray.CopyTo(a, index);
        }
        public int Count
        {
            get { return EmployeeArray.Count; }
        }
        public object SyncRoot
        {
            get { return this; }
        }
        public bool IsSynchronized
        {
            get { return false; }
        }
        public IEnumerator GetEnumerator()
        {
            return EmployeeArray.GetEnumerator();
        }

        public void Add(Employee newEmployee)
        {
            EmployeeArray.Add(newEmployee);
        }
    }
}
